import { UserEntity } from '@/src/user/entities/user.entity'
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
// import * as bcrypt from 'bcryptjs'

@Entity('comment')
export class CommentEntity {
  @PrimaryGeneratedColumn()
  id: number

  @Column({ length: 100 })
  name: string

  @Column()
  user_id: number

  @Column({ default: Math.floor(Date.now() / 1000) })
  create_time: number

  @Column({ type: 'tinyint', default: 0, comment: '是否删除 0未删 1已删' })
  is_del?: number

  @ManyToOne(() => UserEntity)
  @JoinColumn({ name: 'user_id' })
  user?: UserEntity
}